$(function () {
$("#loginsubmit").click(function(){
    let postData={name:$("#nameinput").val(),pwd:$("#passwordinput").val()};
     $.ajax({
          url : "/job/user/login",
          async : false,
          type : "POST",
          contentType : 'application/json',
          dataType : 'json',
          data :JSON.stringify(postData),
          success : function(data) {
                console.log(data);
               if("成功"==data.msg){
                    window.location.href="/job/index.html";
               }else{
                    alert(data.msg);
               }

          }
            });



});



$("#registersubmit").click(function(){
    let postData={name:$("#registernameinput").val(),pwd:$("#registerpasswordinput").val()};
     $.ajax({
          url : "/job/user/register",
          async : false,
          type : "POST",
          contentType : 'application/json',
          dataType : 'json',
          data :JSON.stringify(postData),
          success : function(data) {
                    console.log(data);
                    window.location.href="/job/login.html";
          }
            });



});

});